#include <iostream>
#include <cstring>

using namespace std;

class Person {
public:
    Person();
    Person(long userId, const string &userName, const string &gender) : userId(userId), userName(userName),
                                                                        gender(gender) {}
    long getUserId() const {
        return userId;
    }

    void setUserId(long userId) {
        Person::userId = userId;
    }

    const string &getUserName() const {
        return userName;
    }

    void setUserName(const string &userName) {
        Person::userName = userName;
    }

    const string &getGender() const {
        return gender;
    }

    void setGender(const string &gender) {
        Person::gender = gender;
    }

    /**
     * 打印信息
     */
    void toString() {
        cout << "--------------------------------------------" << endl;
        cout << "userId:" << userId << " ｜ userName:" << userName << " ｜ gender:" << gender << endl;
        cout << "--------------------------------------------" << endl;
    }
private:
    long userId;
    string userName;
    string gender;


};

int main() {
    //使用构造方法
    Person p(10001,"张三","男");
    /*Person p1=*new Person();
    p1.setUserName("李四");
    p1.setGender("男");
    p1.setUserId(10002);*/
    //Person p1=*new Person();
    /*p.userId = 10001;
    p.userName = "styx";
    p.gender = "male";
*/
   /* p.setGender("男");
    p.setUserId(10001);
    p.setUserName("张三");*/
    p.toString();
    //p1.toString();

    return 0;
}
